<html>
<head><meta charset="utf-8"><title>view hir-tree in terminal · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/view.20hir-tree.20in.20terminal.html">view hir-tree in terminal</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240958581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/view%20hir-tree%20in%20terminal/near/240958581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lengyijun <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/view.20hir-tree.20in.20terminal.html#240958581">(Jun 01 2021 at 15:23)</a>:</h4>
<p>The output of hir-tree is quite long:</p>
<div class="codehilite"><pre><span></span><code>cargo rustc -- -Z unpretty=hir-tree
</code></pre></div>
<p>I try to stream the output into <code>jq</code>, but it's not standard json and <code>jq</code> can't recognize it.<br>
Is there any way to view hir-tree interactively (such as folding) in terminal?</p>



<a name="240959736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/view%20hir-tree%20in%20terminal/near/240959736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/view.20hir-tree.20in.20terminal.html#240959736">(Jun 01 2021 at 15:30)</a>:</h4>
<p>It isn't even json at all. It is just the default debug printing format. (basically <code>println!("{:#?}", hir)</code>)</p>



<a name="240959808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/view%20hir-tree%20in%20terminal/near/240959808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/view.20hir-tree.20in.20terminal.html#240959808">(Jun 01 2021 at 15:31)</a>:</h4>
<p>I don't think you can do it in a terminal, but you could try copy pasting it to an editor that supports code folding.</p>



<a name="241094886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/view%20hir-tree%20in%20terminal/near/241094886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lengyijun <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/view.20hir-tree.20in.20terminal.html#241094886">(Jun 02 2021 at 01:03)</a>:</h4>
<p>Which editor can fold it? My vim and kate can't fold it.</p>



<a name="241107353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/view%20hir-tree%20in%20terminal/near/241107353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/view.20hir-tree.20in.20terminal.html#241107353">(Jun 02 2021 at 05:29)</a>:</h4>
<p>VS Code can fold based on indentation, and it seems to work.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>